package demo;

import demo.method.ShopMethod;
import demo.method.UserMethod;
import demo.method.impl.UserMethodImpl;
import demo.plugin.ShopMethodPlugin;
import demo.plugin.UserMethodPlugin;
import sourcecode.Transfer;

public class Main {

    public static void main(String[] args) throws NoSuchMethodException {
        Transfer.interceptorChain.addInterceptor(new UserMethodPlugin()).add(new ShopMethodPlugin());
        UserMethod userMethod = (UserMethod) Transfer.convert(new UserMethodImpl());
        System.out.println(userMethod.getUserName(1));
        System.out.println(userMethod.getUserMobile(1));
    }
}
